package GUI;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.Point;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class Frame extends JFrame {
	JPanel panel_1;
	private JPanel contentPane;
	private JPanel curpannel;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Frame frame = new Frame();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Frame() {
		curpannel= null;
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 550, 500);
		contentPane = new JPanel();
		//contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		//contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setBounds(0, 0, 534, 71);
		contentPane.add(panel);
		panel.setLayout(null);
		
		JButton btnNewButton = new JButton("?");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				System.out.println("????????????????????");
			}
		});
		btnNewButton.setBounds(10, 11, 74, 31);
		panel.add(btnNewButton);
		
		 panel_1 = new JPanel();
		panel_1.setBounds(0, 67, 534, 395);
		contentPane.add(panel_1);
		panel_1.setLayout(new BorderLayout(0, 0));
		this.setVisible(true);
	}
	public void PutPannel(JPanel pan){
		
		if ( curpannel!=null  )
			this.panel_1.remove(curpannel);
		curpannel= pan;
		this.panel_1.add(curpannel,BorderLayout.CENTER);
		this.curpannel.revalidate();
		this.curpannel.repaint();
		
	}
}
